package com.quick.domain;


import lombok.val;

import java.util.*;

/**
 * Val可以将变量申明是final类型
 * Created by wangxin332 on 2018/5/13.
 */
public class UseVal {
    public static void main(String[] args) {
        val setVar = new HashSet<String>();
        val listsVar = new ArrayList<String>();
        val mapVar = new HashMap<String,String>();

        //等同于

        final Set<String> setVar2 = new HashSet<>();
        final List<String> listsVar2 = new ArrayList<>();
        final Map<String,String> mapVar2 = new HashMap<>();
    }
}
